<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
    <script type="text/javascript">
        // 'use strict'
        
        let age = 100
        console.log(this);
        
        //函数中的this 指向谁 是由 调用方式决定
        function sayHi(name){
            console.log("sayHi,this = ",this);
            // console.log("sayHi,this = ",this+"name="+name);

        
            
        }

        // sayHi()
        
        sayHi.bind(1000,"张三").call()


        function Person(){
            this.sayHi = function(){
                console.log("Person sayHi,this = ",this);
            }
        }

        const zhangsan = new Person();
        zhangsan.name = "张飞"
        zhangsan.sayHi()




        


    </script>



    <button onclick="sayHi()">点我</button>
</body>
</html>